<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head th:replace="~{fragments/header :: header}">
</head>
<body>
<div sec:authorize="isAuthenticated()">
    <table class="table">
        <tr class="warning">
            <th>编号</th>
            <th>图书</th>
            <th>作者</th>
            <th>出版社</th>
            <th>价格</th>
            <th><a th:href="@{/book/add}">添加</a></th>
        </tr>
        <tr class="success" th:each="book:${book}">
            <td th:text="${book.id}"></td>
            <td th:text="${book.name}"></td>
            <td th:text="${book.author}"></td>
            <td th:text="${book.publishing}"></td>
            <td th:text="${book.price}"></td>
            <td>
                <a th:href="@{/book/edit}">编辑</a>
                <a th:href="'/book/delete/' + ${book.id}" >删除</a>
            </td>
        </tr>

    </table>

</div>
<div class="container blog-content-container" sec:authorize="isAnonymous()">
    <h1>非法登录</h1>
</div>

<div th:replace="~{fragments/footer :: footer}">...</div>
<script src="../../js/index/main.js" th:src="@{/js/index/main.js}"></script>
</body>
</html>